<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2020/10/26
  Time: 9:42
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>Title</title>
    <script>
        function doPage(pageNo) {
            document.forms[0].pageNo.value = pageNo;
            document.forms[0].submit();
        }
    </script>
</head>
<body>
<h1>
    用户列表
</h1>
<form action="userServlet?opt=list" method="post">
    <input type="hidden" name="pageNo">
    用户名:<input name="realName" value="${realName}"><br/>
    角色:<select name="roleIds" multiple>
    <option value="1">1111</option>
    <option value="2">2222</option>
    <option value="3">3333</option>
</select>
    <input type="submit" value="查询">
    <table>
        <tr>
            <td>id</td>
            <td>用户名</td>
            <td>角色ID</td>
        </tr>
        <c:forEach items="${list}" var="user">
            <tr>
                <td>${user.id}</td>
                <td>${user.realName}</td>
                <td>${user.roleId}</td>
            </tr>
        </c:forEach>
    </table>
    <div>
        <div>共${total}条，${pageNo}/${totalPageCount}页，每页${pageSize}条</div>
        <div>
            <a href="javascript:doPage(1)">首页</a>
            <a href="javascript:doPage(${pageNo-1})">上页</a>
            <a href="javascript:doPage(${pageNo+1})">下页</a>
            <a href="javascript:doPage(${totalPageCount})">尾页</a>
        </div>
    </div>
</form>
</body>
</html>
